import instance from "@/utils/request";

export const Dept_list = () => {
    let url = "system/dept/depts"
    return instance.get(url) 
}

export const add_new_department = (date_dict) => {
    let url = "system/dept/depts"
    return instance.post(url,  date_dict)
}

export const get_one_department = (data) => {
    let url = "/system/dept/dept/"+data
    return instance.get(url)
}

export const edit_one_department = (id,data) => {
    let url = "/system/dept/depts/"+id
    return instance.put(url,{...data})
}

export const delete_department = (ids) => {
    let url = "/system/dept/depts"
    return instance.delete(url,{data:ids})
}

export const tree_dept = () => {
    let url = '/system/dept/tree/depts'
    return instance.get(url)
}